package com.training.java.core.collections.maps.post15;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class KeySetDemo {

	public static void main(String[] args) {
		
Map<String,String> studentAndFavFruits =new HashMap<>();
		
		studentAndFavFruits.put("reenu", "Mango");//value is overwritten with duplicate key  
		studentAndFavFruits.put("Sushmita", "orange");
		studentAndFavFruits.put("Satya", "Banana");
		studentAndFavFruits.put("Reenu", "mango");
		studentAndFavFruits.put("Mira", "Kiwi");
		studentAndFavFruits.put("reenu", "kiwi");
		
		Set<String>keys=studentAndFavFruits.keySet();
		for(String key: keys)
		{
			System.out.println("Key:"+ key);
			String value=studentAndFavFruits.get(key);
			System.out.println("Value:" + value);
			System.out.println("************");
		}
	}

}
